import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV);

export default {
  path: '/ad',
  component: Layout,
  name: 'ad',
  meta: {title: '广告管理', icon: 'icon'},
  children: [
    // {
    //   path: 'homeGrass',
    //   component: _import('ad/homeGrass/list'),
    //   name: 'homeGrass',
    //   meta: {
    //     title: '首页种草管理',
    //     buttons: {
    //       save: { label: '保存', enabled: true }
    //     }
    //   },
    // },
    {
      path: 'productRecommend',
      component: _import('ad/productRecommend/list'),
      name: 'productRecommend',
      meta: {
        title: '分类商品推荐',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true },
          del: { label: '删除', enabled: true },
          batchDel: { label: '批量删除', enabled: true }
        }
      },
    },
    {
      path: 'productRecommendAdd',
      component: _import('ad/productRecommend/edit'),
      name: 'productRecommendAdd',
      meta: {title: '分类商品推荐添加'},
      hidden: true
    },
    {
      path: 'productRecommendEdit/:id',
      component: _import('ad/productRecommend/edit'),
      name: 'productRecommendEdit',
      meta: {title: '分类商品推荐编辑'},
      hidden: true,
      props: true
    },
    {
      path: 'list',
      component: _import('ad/manage/list'),
      name: 'adManage',
      meta: {
        title: '广告管理',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true }
        }
      },
    },
    {
      path: 'add',
      component: _import('ad/manage/edit'),
      name: 'adManageAdd',
      meta: {title: '广告添加'},
      hidden: true
    },
    {
      path: 'edit/:id',
      component: _import('ad/manage/edit'),
      name: 'adManageEdit',
      meta: {title: '广告编辑', noCache: true, index: '/ad/list'},
      hidden: true,
      props: true
    },
    {
      path: 'newUserAd',
      component: _import('ad/manage/newUserAd'),
      name: 'newUserAd',
      meta: {
        title: '新人专享广告位',
        buttons: {
          edit: { label: '编辑', enabled: true }
        }
      },
    },
    {
      path: 'position',
      component: _import('ad/position/list'),
      name: 'adPosition',
      meta: {
        title: '广告位管理',
        buttons: {
          detail: { label: '广告位详情', enabled: true }
        }
      },
    },
    {
      path: 'position/detail/:id',
      component: _import('ad/position/detail'),
      name: 'adPositionDetail',
      meta: {title: '广告位详情', noCache: true, index: '/ad/position'},
      hidden: true,
      props: true
    },
    {
      path: 'icon',
      component: _import('ad/icon/list'),
      name: 'iconList',
      meta: {
        title: '首页ico栏目',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true },
          visible: { label: '显示/隐藏', enabled: true },
          sort: { label: '排序', enabled: true }
        }
      },
      props: true
    },
    {
      path: 'home/notice',
      component: _import('ad/home/notice'),
      name: 'homeNotice',
      meta: {
        title: '首页公告',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true }
        }
      }
    },
    {
      path: 'home/tab',
      component: _import('ad/home/tab/list'),
      name: 'homeTab',
      meta: {
        title: '首页Tab管理',
        buttons: {
          add: { label: '新建', enabled: true },
          edit: { label: '编辑', enabled: true },
          setDefault: { label: '设为默认', enabled: true }
        }
      }
    },
    {
      path: 'home/tab/add',
      component: _import('ad/home/tab/edit'),
      name: 'homeTabAdd',
      meta: {title: '新建首页Tab页'},
      hidden: true
    },
    {
      path: 'home/tab/:id/edit',
      component: _import('ad/home/tab/edit'),
      name: 'homeTabEdit',
      meta: {title: '编辑首页Tab页'},
      hidden: true,
      props: true
    },
    {
      path: 'background',
      component: _import('ad/indexBackground/index'),
      name: 'indexBg',
      meta: {
        title: '首页背景图管理',
        buttons: {
          edit: { label: '编辑', enabled: true },
          visible: { label: '显示/隐藏', enabled: true }
        }
      },
      props: true
    },
    {
      path: 'fixed',
      component: _import('ad/fixed/list'),
      name: 'adFixed',
      meta: {
        title: '固定广告',
        buttons: {
          edit: { label: '编辑', enabled: true }
        }
      },
      props: true
    },
    {
      path: 'fixed/edit',
      component: _import('ad/fixed/edit'),
      name: 'adFixedEdit',
      meta: { title: '38元礼包支付成功弹窗界面设置', noCache: true, index: '/ad/fixed' },
      hidden: true,
      props: true
    },
  ]
}
